{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "from em_examples.Attenuation import AttenuationWidgetTBL"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Attenuation of EM wave"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To simplify the GPR problem, we assumed that we do not have conductivity effect. However, in practice, this is not true. For instance, the earth medium can have considerably high conductivity values. In this case, EM wave attenuates as a function of conductivity ($\\sigma$), permittivity ($\\epsilon$), and frequency ($f$). Thus, we can write velocity of EM wave as:\n",
    "\n",
    "$$ v(\\sigma, f, \\epsilon)$$\n",
    "\n",
    "In addition, electromagnetic wave, which propagates in the earth attenuates in several reasons why:\n",
    "\n",
    "- Geometric decaying\n",
    "- Electrical conductivity ($\\sigma$, S/m)\n",
    "\n",
    "To measure how much it attenuates we define skin depth as the depth at which the intensity of the radiation inside the material falls to 1/e (about 37%) of its original value. And it can be written as:\n",
    "\n",
    "$$ \\delta(\\sigma, f, \\epsilon) $$\n",
    "\n",
    "By adjusting parameters below, you will indentify how velocity and skin depth change as a function of $\\sigma$, $\\epsilon$, and $f$."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Parameters:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- $\\epsilon_r$: Relative permittivity of the medium\n",
    "\n",
    "- $log(\\sigma)$: Log10(Conductivity, S/m)\n",
    "\n",
    "- $log(f)$: Log10(frequency, Hz)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "3e6ba6a6d88d4ed28efbd086da0ffc07",
       "version_major": 2,
       "version_minor": 0
      },
      "text/html": [
       "<p>Failed to display Jupyter Widget of type <code>interactive</code>.</p>\n",
       "<p>\n",
       "  If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n",
       "  that the widgets JavaScript is still loading. If this message persists, it\n",
       "  likely means that the widgets JavaScript library is either not installed or\n",
       "  not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n",
       "  Widgets Documentation</a> for setup instructions.\n",
       "</p>\n",
       "<p>\n",
       "  If you're reading this message in another frontend (for example, a static\n",
       "  rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n",
       "  it may mean that your frontend doesn't currently support widgets.\n",
       "</p>\n"
      ],
      "text/plain": [
       "interactive(children=(FloatText(value=9.0, description='$\\\\epsilon_r$'), FloatSlider(value=-1.5, description='log$(\\\\sigma)$', max=1.0, min=-4.0, step=0.5), FloatSlider(value=5.5, description='log$(f)$', max=10.0, min=5.0, step=0.5), Output()), _dom_classes=('widget-interact',))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "<function em_examples.Attenuation.WaveVelandSkindWidgetTBL>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "AttenuationWidgetTBL()"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  },
  "widgets": {
   "state": {
    "234b50583b3246edb24ab70aee35c4e4": {
     "views": [
      {
       "cell_index": 5
      }
     ]
    }
   },
   "version": "1.2.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
